﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


class Course
{

    private string Name
    {
        get;
        set;
    }

    private HashSet<Student> StudentsInCourse
    {
        get;
        set;
    }

    public Course(string name)
    {
        this.Name = name;
        this.StudentsInCourse = new HashSet<Student>();
    }

    public void EnrollStudent(Student student)
    {
        if (StudentsInCourse.Count == 30)
        {
            throw new Exception("Course reached maximum number of enrolled students! You cannot be enrolled!");
        }

        StudentsInCourse.Add(student);
    }

    public void RemoveStudent(Student stud)
    {
        if (!StudentsInCourse.Contains(stud))
            throw new ArgumentException("You are trying to remove student that is not enrolled in the course!");

        StudentsInCourse.Remove(stud);
    }

    static void Main()
    {
 
    }
}

